package com.axonactive.training.dao;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.axonactive.training.model.Expense;

@Stateless
public class ExpenseDao {
	@PersistenceContext
	private EntityManager em;
	
	public void saveExpense(Expense expense){
		em.persist(expense);
	}
	
	public List<Expense> getExpenseList(){
		return em.createQuery("select e from Expense e", Expense.class).getResultList();		
	}
}
